from django.db import models
from django.contrib.auth.models import AbstractUser

# Create your models here.


# 用户信息
class UserProfile(AbstractUser):
    GENDER_CHOICES = (
        ('secrecy', u'保密'),
        ('male', u'男'),
        ('female', u'女')
    )
    gender = models.CharField(choices=GENDER_CHOICES, max_length=7, default='secrecy', verbose_name=u'性别')
    mobile = models.CharField(max_length=11, verbose_name=u'手机号')
    birthday = models.DateField(verbose_name=u'生日', null=True, blank=True)
    want_to_say = models.TextField(default='', verbose_name=u'想说的话', blank=True)


# 注册验证
class VerifyCode(models.Model):
    # TYPE_CHOICES = (
    #     ('register', u'注册'),
    #     ('forget', u'密码找回')
    # )
    code = models.CharField(max_length=6, verbose_name=u'验证码')
    mobile = models.CharField(max_length=11, verbose_name=u'手机号')
    # send_type = models.CharField(choices=TYPE_CHOICES, max_length=20, verbose_name=u'验证码类型')
    send_time = models.DateTimeField(auto_now_add=True, verbose_name=u'发送时间')

    class Meta:
        verbose_name = u'短信验证'
        verbose_name_plural = verbose_name

    def __str__(self):
        self.mobile

